import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

import 'package:get/get.dart';

import '../../../routes/app_pages.dart';
import '../controllers/dismiss_account_controller.dart';

class DismissAccountView extends GetView<DismissAccountController> {
  const DismissAccountView({super.key});
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('注销账户'),
        centerTitle: true,
        leading: IconButton(
          icon: Image.asset('assets/images/ic_back2.png',width: 48.w,height: 48.h),
          onPressed: () {
            Get.back();
          },
          tooltip: MaterialLocalizations.of(context).backButtonTooltip, // 可选：设置工具提示
        ),
      ),
      body: Obx(()=>Container(
        padding: EdgeInsets.only(left: 40.w,right: 40.w),
        child: ListView(
          children: [
            SizedBox(height: 30.h,),
            Text('重要提醒',style: TextStyle(fontSize: 32.sp,fontWeight: FontWeight.bold)),
            Text('账号注销后,您将无法再使用该账号,包括但不限于:',style: TextStyle(fontSize: 30.sp)),
            SizedBox(height: 21.h,),
            Text('1.无法登录',style: TextStyle(fontSize: 32.sp,fontWeight: FontWeight.bold)),
            SizedBox(height: 21.h,),
            Text('2.清除账号所有信息,包括:',style: TextStyle(fontSize: 32.sp,fontWeight: FontWeight.bold)),
            SizedBox(height: 21.h,),
            Row(
              children: [
                Container(
                  width: 5, // 小圆点的宽度
                  height: 5, // 小圆点的高度
                  decoration: BoxDecoration(
                    shape: BoxShape.circle, // 设置形状为圆形
                    color: Colors.black, // 设置颜色为黑色
                  ),
                ),
                Text('个人资料',style: TextStyle(fontSize: 30.sp)),
              ],
            ),
            Row(
              children: [
                Container(
                  width: 5, // 小圆点的宽度
                  height: 5, // 小圆点的高度
                  decoration: BoxDecoration(
                    shape: BoxShape.circle, // 设置形状为圆形
                    color: Colors.black, // 设置颜色为黑色
                  ),
                ),
                Text('编程作品',style: TextStyle(fontSize: 30.sp)),
              ],
            ),
            Row(
              children: [
                Container(
                  width: 5, // 小圆点的宽度
                  height: 5, // 小圆点的高度
                  decoration: BoxDecoration(
                    shape: BoxShape.circle, // 设置形状为圆形
                    color: Colors.black, // 设置颜色为黑色
                  ),
                ),
                Text('动作设计作品',style: TextStyle(fontSize: 30.sp)),
              ],
            ),
            Row(
              children: [
                Container(
                  width: 5, // 小圆点的宽度
                  height: 5, // 小圆点的高度
                  decoration: BoxDecoration(
                    shape: BoxShape.circle, // 设置形状为圆形
                    color: Colors.black, // 设置颜色为黑色
                  ),
                ),
                Text('对话记录',style: TextStyle(fontSize: 30.sp)),
              ],
            ),
            Row(
              children: [
                Container(
                  width: 5, // 小圆点的宽度
                  height: 5, // 小圆点的高度
                  decoration: BoxDecoration(
                    shape: BoxShape.circle, // 设置形状为圆形
                    color: Colors.black, // 设置颜色为黑色
                  ),
                ),
                Text('机器人长期记忆',style: TextStyle(fontSize: 30.sp)),
              ],
            ),
            Row(
              children: [
                Container(
                  width: 5, // 小圆点的宽度
                  height: 5, // 小圆点的高度
                  decoration: BoxDecoration(
                    shape: BoxShape.circle, // 设置形状为圆形
                    color: Colors.black, // 设置颜色为黑色
                  ),
                ),
                Text('机器人自主智能,Wi-Fi等设置记录',style: TextStyle(fontSize: 30.sp)),
              ],
            ),
            SizedBox(height: 21.h,),
            Text('3.解绑账号下的所有机器人',style: TextStyle(fontSize: 32.sp,fontWeight: FontWeight.bold)),
            SizedBox(height: 498.h),
            Row(
              mainAxisAlignment: MainAxisAlignment.center,
              children: [
                Checkbox(value: controller.checkBoxchecked.value, onChanged: (v) {
                  controller.checkBoxchecked.value = !controller.checkBoxchecked.value;

                }),
                GestureDetector(
                  onTap: () {
                    controller.checkBoxchecked.value = !controller.checkBoxchecked.value;
                  },
                  child: Text('我已知晓风险,确认继续注销账号'),
                )

              ],
            ),
            SizedBox(height: 20.h),
            Container(
              width: 594.w,
              child: ElevatedButton(
                  onPressed: controller.checkBoxchecked.value ? () {
                    Get.toNamed(Routes.DISMISS_ACCOUNT_FIANL);
                  }: null,
                  child: const Text("下一步")
              ),
            )


          ],
        ),
      ),)
    );
  }
}
